package GameStates;


import java.awt.Color;
import java.io.IOException;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import GameFiles.StateBase;
import Gui.GameFrame;
import Gui.ImagePanel;


public class MainMenu extends StateBase
{
	private ImagePanel img; 
	private static MainMenu ref;
	private static final Color FOREGROUND_COLOR = new Color(255,0,0);
	private static final Color BACKGROUND_COLOR = new Color(0,0,0);
	/**
	 * Creates a MainMenu Singleton
	 * @return MainMenu Object
	 */
	public static MainMenu getInstance()
	{
		if (ref == null)
			// it's ok, we can call this constructor
			ref = new MainMenu();
		return ref;
	}

	public boolean Draw(GameFrame gf)
	{
		gf.setBackground(BACKGROUND_COLOR);
		JLabel topLabel = new JLabel("MAIN MENU",0);
		topLabel.setBounds(600, 50, 100,10);
		topLabel.setForeground(FOREGROUND_COLOR);
		return false;
	}

	@Override
	public boolean Enter()
	{

		GameFrame.getInstance().setBackground(Color.white);
		JLabel topLabel = new JLabel("MAIN MENU",0);	
		topLabel.setBounds(600, 50, 100,10);
		topLabel.setForeground(FOREGROUND_COLOR);
		// prints an image
		try {
		
			img = new ImagePanel(new ImageIcon(new URL("http://www.stevenbankhead.com/GSP_Project/Images/paydayart2.gif")).getImage());
			GameFrame.getInstance().add(img);
		}
		catch (IOException e) {
			e.printStackTrace();
		}

		
		
		
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean Execute()
	{
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean Exit()
	{
		GameFrame.getInstance().removeAll();
		return false;
	}
}
